package com.winexpress.support;

import com.winexpress.session.support.NotificationSessionBean;
import javax.ejb.EJB;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

@WebService(serviceName = "NotificationManagementWS")
public class NotificationManagementWS {
    
    @EJB
    private NotificationSessionBean notificationSessionBean;
    
    @WebMethod(operationName = "createTopic")
    public boolean createTopic() throws Exception{
        return notificationSessionBean.createTopic();
    }
    
    @WebMethod(operationName = "sendNotification")
    public boolean sendNotification(NotificationObject obj){
        
        String title=obj.getTitle();
        String content=obj.getContent();
        return notificationSessionBean.sendNotification(title, content);
    }
    
    @WebMethod(operationName="addSubscriber")
    public boolean addSubscriber(@WebParam(name = "email") String email){
        return notificationSessionBean.addSubscriber(email);
    }
    
    @WebMethod(operationName="deleteSubscriber")
    public boolean deleteSubscriber(@WebParam(name = "email") String email){
        return notificationSessionBean.deleteSubscriber(email);
    }
    
    
}
